package com.bestow.loan.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.loan.mapper.InvFinanceProductsMapper;
import com.bestow.loan.domain.InvFinanceProducts;
import com.bestow.loan.service.IInvFinanceProductsService;

/**
 * 理财产品定义Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-04
 */
@Service
public class InvFinanceProductsServiceImpl implements IInvFinanceProductsService 
{
    @Autowired
    private InvFinanceProductsMapper invFinanceProductsMapper;

    /**
     * 查询理财产品定义
     * 
     * @param financeProductsId 理财产品定义主键
     * @return 理财产品定义
     */
    @Override
    public InvFinanceProducts selectInvFinanceProductsByFinanceProductsId(Long financeProductsId)
    {
        return invFinanceProductsMapper.selectInvFinanceProductsByFinanceProductsId(financeProductsId);
    }

    /**
     * 查询理财产品定义列表
     * 
     * @param invFinanceProducts 理财产品定义
     * @return 理财产品定义
     */
    @Override
    public List<InvFinanceProducts> selectInvFinanceProductsList(InvFinanceProducts invFinanceProducts)
    {
        return invFinanceProductsMapper.selectInvFinanceProductsList(invFinanceProducts);
    }

    /**
     * 新增理财产品定义
     * 
     * @param invFinanceProducts 理财产品定义
     * @return 结果
     */
    @Override
    public int insertInvFinanceProducts(InvFinanceProducts invFinanceProducts)
    {
        invFinanceProducts.setCreateTime(DateUtils.getNowDate());
        return invFinanceProductsMapper.insertInvFinanceProducts(invFinanceProducts);
    }

    /**
     * 修改理财产品定义
     * 
     * @param invFinanceProducts 理财产品定义
     * @return 结果
     */
    @Override
    public int updateInvFinanceProducts(InvFinanceProducts invFinanceProducts)
    {
        invFinanceProducts.setUpdateTime(DateUtils.getNowDate());
        return invFinanceProductsMapper.updateInvFinanceProducts(invFinanceProducts);
    }

    /**
     * 批量删除理财产品定义
     * 
     * @param financeProductsIds 需要删除的理财产品定义主键
     * @return 结果
     */
    @Override
    public int deleteInvFinanceProductsByFinanceProductsIds(Long[] financeProductsIds)
    {
        return invFinanceProductsMapper.deleteInvFinanceProductsByFinanceProductsIds(financeProductsIds);
    }

    /**
     * 删除理财产品定义信息
     * 
     * @param financeProductsId 理财产品定义主键
     * @return 结果
     */
    @Override
    public int deleteInvFinanceProductsByFinanceProductsId(Long financeProductsId)
    {
        return invFinanceProductsMapper.deleteInvFinanceProductsByFinanceProductsId(financeProductsId);
    }
}
